package com.packagetracker.entities;

import com.packagetracker.R;
import com.packagetracker.carriers.handlers.PackageHandler;
import com.packagetracker.carriers.handlers.UpsHandler;
import com.packagetracker.carriers.handlers.UspsHandler;

public class Carrier {
	
	private int carrierId;
	private int icon;
	private PackageHandler handler;
	
	public static final int UPS = 0;
	public static final int USPS = 1;
	
	public Carrier(final int carrierId) {
		this.setCarrierId(carrierId);
		
		switch (this.carrierId) {
			case UPS:
				this.setIcon(R.drawable.icon_ups);
				this.setHandler(new UpsHandler());
				break;
				
			case USPS:
				this.setIcon(R.drawable.icon_usps);
				this.setHandler(new UspsHandler());
				break;
		}
	}
	
	public Carrier get() {
		return this;
	}
	
	public int getCarrierId() {
		return this.carrierId;
	}
	
	public int getIcon() {
		return this.icon;
	}
	
	public PackageHandler getHandler() {
		return this.handler;
	}
	
	public void setCarrierId(final int carrierId) {
		this.carrierId = carrierId;
	}
	
	public void setIcon(final int icon) {
		this.icon = icon;
	}
	
	public void setHandler(final PackageHandler handler) {
		this.handler = handler;
	}
	
}